#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void rev(char arr[],int sz,int num)
{
	int i = 0;
	int j = 0;
    for(i=0;i<num;i++)
	{
		char tmp = arr[0];
	    for(j=0;j<sz-1;j++)
		{
			 arr[j] = arr[j+1];
		}
		arr[j] = tmp;
	}
}
int main ()
{
	char arr[] = "ABCD";
	int sz = sizeof(arr)/sizeof(arr[0])-1;
	int num = 0;
	scanf("%d",&num);
	rev(arr,sz,num);
	printf("%s\n",arr);
	return 0;
}

